home *** CD-ROM | disk | FTP | other *** search
- Path: noc.netcom.net!news
- From: Tarang Deshpande <tarang@willows.com>
- Newsgroups: comp.lang.c
- Subject: Re: malloc help needed
- Date: Thu, 28 Mar 1996 11:38:13 -0800
- Organization: NETCOM Network Operations
- Message-ID: <315AEAA5.35E6@willows.com>
- References: <1996Mar28.113702.15788@leeds.ac.uk>
- NNTP-Posting-Host: daffy.willows.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB2 (Win95; I)
-
- A M Casey wrote:
- >
- > char *Item[20];
- >
- > char *tempcontents[50];
- >
- > for(count = 0; count <=20;count++)
- > {
- > Item[count] = malloc(50);
- > }
- > for(count = 0; count <=50;count++)
- > {
- > tempcontents[count] = malloc(50);
- > }
- >
-
- First thing change your loop condition to < as opposed to <=.
-
- This should fix your problem. If it doesn't repost and I'll take
- a further look.
-